package com.loctek.importexport.http;


import com.loctek.importexport.bean.LoginResponse;
import com.loctek.importexport.bean.addRecordResponse;
import com.loctek.importexport.bean.bookLearnrecordByAjaxResponse;
import com.loctek.importexport.bean.bookSearchByRecommendedResponse;
import com.loctek.importexport.bean.bookSearchByTypeAjaxResponse;
import com.loctek.importexport.bean.bookSearchContentAutoResponse;
import com.loctek.importexport.bean.bookSearchContentResponse;
import com.loctek.importexport.bean.bookSearchInfoResponse;
import com.loctek.importexport.bean.commentAddByAjaxResponse;
import com.loctek.importexport.bean.courseSearchByRecommendedResponse;
import com.loctek.importexport.bean.courseSearchByTypeAjaxResponse;
import com.loctek.importexport.bean.courseSearchInfoResponse;
import com.loctek.importexport.bean.downloadResponse;
import com.loctek.importexport.bean.examStartResponse;
import com.loctek.importexport.bean.examrecordListResponse;
import com.loctek.importexport.bean.getproductResponse;
import com.loctek.importexport.bean.getstoresiteResponse;
import com.loctek.importexport.bean.intostoresiteResponse;
import com.loctek.importexport.bean.learnOverviewResponse;
import com.loctek.importexport.bean.learnSearchByAjaxResponse;
import com.loctek.importexport.bean.learnrecordResponse;
import com.loctek.importexport.bean.myParamsetResponse;
import com.loctek.importexport.bean.myRankingResponse;
import com.loctek.importexport.bean.newsSearchByTypeAjaxResponse;
import com.loctek.importexport.bean.newsSearchInfoResponse;
import com.loctek.importexport.bean.oneYearScoreSituationResponse;
import com.loctek.importexport.bean.outstoresiteResponse;
import com.loctek.importexport.bean.paramsetSearchByAjaxResponse;
import com.loctek.importexport.bean.sectionListResponse;
import com.loctek.importexport.bean.selectCommentByPageResponse;
import com.loctek.importexport.bean.switchstoresiteResponse;
import com.loctek.importexport.bean.testpaperSearchByAjaxResponse;
import com.loctek.importexport.bean.testpaperStartIsOkResponse;
import com.loctek.importexport.bean.updateMyParamsetResponse;
import com.loctek.importexport.bean.updatePwdResponse;
import com.loctek.importexport.bean.updateUserInfoResponse;
import com.loctek.importexport.bean.updateVideoTime_fResponse;
import com.loctek.importexport.bean.userInfoResponse;
import com.loctek.importexport.bean.videoSearchByRecommendedResponse;
import com.loctek.importexport.bean.videoSearchByTypeAjaxResponse;
import com.loctek.importexport.bean.videoSearchInfoResponse;
import com.loctek.importexport.bean.voiceSearchByTypeAjaxResponse;
import com.loctek.importexport.bean.voiceSearchInfoResponse;


import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * ━━━━━━神兽出没━━━━━━
 * 　　　┏┓　　　┏┓
 * 　　┏┛┻━━━┛┻┓
 * 　　┃　　　　　　　┃
 * 　　┃　　　━　　　┃
 * 　　┃　┳┛　┗┳　┃
 * 　　┃　　　　　　　┃
 * 　　┃　　　┻　　　┃
 * 　　┃　　　　　　　┃
 * 　　┗━┓　　　┏━┛
 * 　　　　┃　　　┃  神兽保佑
 * 　　　　┃　　　┃  代码无bug
 * 　　　　┃　　　┗━━━┓
 * 　　　　┃　　　　　　　┣┓
 * 　　　　┃　　　　　　　┏┛
 * 　　　　┗┓┓┏━┳┓┏┛
 * 　　　　　┃┫┫　┃┫┫
 * 　　　　　┗┻┛　┗┻┛
 * ━━━━━━感觉萌萌哒━━━━━━
 * <p>
 * 作者：司海林
 * 邮箱：sihailin@sina.cn
 * 时间：2017/9/14
 * 描述：
 */
public interface APIService {

    /****************************************通知*******************************************************/
    //通知列表
    @POST("newsSearchByTypeAjax")
    Observable<newsSearchByTypeAjaxResponse> newsSearchByTypeAjax(@Header("Authorization") String authorization, @Query("type") int type, @Query("page.currentPage") int page);

    //通知详情
    @GET("newsSearchInfo")
    Observable<newsSearchInfoResponse> newsSearchInfo(@Header("Authorization") String authorization, @Query("id") int id);

    /****************************************图书中心*******************************************************/

    //推荐图书
    @POST("bookSearchByRecommended")
    Observable<bookSearchByRecommendedResponse> bookSearchByRecommended(@Header("Authorization") String authorization, @Query("page") int page);

    //图书详情
    @POST("bookSearchInfo")
    Observable<bookSearchInfoResponse> bookSearchInfo(@Header("Authorization") String authorization, @Query("id") int id);

    //图书章节列表
    @POST("sectionList")
    Observable<sectionListResponse> sectionList(@Header("Authorization") String authorization, @Query("id") int id);

    //图书章节内容
    @POST("bookSearchContent")
    Observable<bookSearchContentResponse> bookSearchContent(@Header("Authorization") String authorization, @Query("id") int id);

    //图书阅读，和图书章节内容接口类似
    @POST("bookSearchContentAuto")
    Observable<bookSearchContentAutoResponse> bookSearchContentAuto(@Header("Authorization") String authorization, @Query("id") int id);

    //图书阅读，和图书章节内容接口类似
    @POST("bookLearnrecordByAjax")
    Observable<bookLearnrecordByAjaxResponse> bookLearnrecordByAjax(@Header("Authorization") String authorization, @Query("bookid") int bookid, @Query("id") int id);

    //图书列表
    @POST("bookSearchByTypeAjax")
    Observable<bookSearchByTypeAjaxResponse> bookSearchByTypeAjax(@Header("Authorization") String authorization, @Query("type") int type, @Query("page.currentPage") int page);

    //图书下载，实际是查询图书及章节信息，由前端写入文件
    @POST("download")
    Observable<downloadResponse> download(@Header("Authorization") String authorization, @Query("id") int id);

    /****************************************分类*******************************************************/

    //各种分类
    @POST("paramsetSearchByAjax")
    Observable<paramsetSearchByAjaxResponse> paramsetSearchByAjax(@Header("Authorization") String authorization, @Query("type") int type);

    //我的频道
    @POST("myParamset")
    Observable<myParamsetResponse> myParamset(@Header("Authorization") String authorization, @Query("type") int type);

    //我的频道-编辑
    @POST("updateMyParamset")
    Observable<updateMyParamsetResponse> updateMyParamset(@Header("Authorization") String authorization, @Query("type") int type, @Query("id") int id, @Query("pids") String pids);

    /****************************************评论*******************************************************/

    //添加评论
    @POST("commentAddByAjax")
    Observable<commentAddByAjaxResponse> commentAddByAjax(@Header("Authorization") String authorization, @Query("comment.type") int type, @Query("comment.cid") int cid, @Query("comment.content") String content);

    //评论查询
    @POST("selectCommentByPage")
    Observable<selectCommentByPageResponse> selectCommentByPage(@Header("Authorization") String authorization, @Query("type") int type, @Query("id") int id, @Query("page.currentPage") int page);

    /****************************************视频*******************************************************/

    //视频列表
    @POST("videoSearchByTypeAjax")
    Observable<videoSearchByTypeAjaxResponse> videoSearchByTypeAjax(@Header("Authorization") String authorization, @Query("type") int type, @Query("page.currentPage") int page);

    //推荐视频
    @POST("videoSearchByRecommended")
    Observable<videoSearchByRecommendedResponse> videoSearchByRecommended(@Header("Authorization") String authorization, @Query("page.currentPage") int page);

    //视频详情
    @POST("videoSearchInfo")
    Observable<videoSearchInfoResponse> videoSearchInfo(@Header("Authorization") String authorization, @Query("id") int id);

    //更新视频学习时间
    @POST("updateVideoTime_f")
    Observable<updateVideoTime_fResponse> updateVideoTime_f(@Header("Authorization") String authorization, @Query("id") int id, @Query("progress") int progress);

    /****************************************音频*******************************************************/

    //音频列表
    @POST("voiceSearchByTypeAjax")
    Observable<voiceSearchByTypeAjaxResponse> voiceSearchByTypeAjax(@Header("Authorization") String authorization, @Query("type") int type, @Query("page.currentPage") int page);

    //音频详情
    @POST("voiceSearchInfo")
    Observable<voiceSearchInfoResponse> voiceSearchInfo(@Header("Authorization") String authorization, @Query("id") int id);


    /****************************************在线测试*******************************************************/

    //试卷列表
    @GET("testpaperSearchByAjax")
    Observable<testpaperSearchByAjaxResponse> testpaperSearchByAjax(@Header("Authorization") String authorization);

    //开始考试，应该是测试是否能考试
    @GET("testpaperStartIsOk")
    Observable<testpaperStartIsOkResponse> testpaperStartIsOk(@Header("Authorization") String authorization, @Query("id") int id);

    //开始考试，获取试题
    @GET("examStart")
    Observable<examStartResponse> examStart(@Header("Authorization") String authorization, @Query("id") int id);

    //答题
    @POST("addRecord")
    Observable<addRecordResponse> addRecord(@Header("Authorization") String authorization, @Query("examrecord.id") int id, @Query("question") String question, @Query("tscore") float tscore);

    /****************************************个人中心*******************************************************/

    //排名
    @GET("myRanking")
    Observable<myRankingResponse> myRanking(@Header("Authorization") String authorization);

    //个人空间-更多-4个季度的学分
    @GET("oneYearScoreSituation")
    Observable<oneYearScoreSituationResponse> oneYearScoreSituation(@Header("Authorization") String authorization, @Query("year") int year);

    //个人空间-本季度的学分情况
    @GET("learnSearchByAjax")
    Observable<learnSearchByAjaxResponse> learnSearchByAjax(@Header("Authorization") String authorization);

    //学习概况
    @GET("learnOverview")
    Observable<learnOverviewResponse> learnOverview(@Header("Authorization") String authorization);

    //已选课程、视频、图书、进修列表
    @POST("learnrecord")
    Observable<learnrecordResponse> learnrecord(@Header("Authorization") String authorization, @Query("type") int type, @Query("page.currentPage") int page);

    /****************************************我的*******************************************************/

    //登陆
    @POST("pdaservice.do")
    Observable<LoginResponse> login(@Query("method") String method, @Query("username") String username, @Query("password") String password);

    //根据产品条码（UPC或EAN)获取产品信息
    @GET("pdaservice.do")
    Observable<getproductResponse> getproduct(@Query("method") String method, @Query("token") String token, @Query("barcode") String barcode);

    //  根据库位码获取库位信息
    @GET("pdaservice.do")
    Observable<getstoresiteResponse> getstoresite(@Query("method") String method, @Query("token") String token, @Query("storesite") String storesite);

    //入库
    @POST("pdaservice.do")
    Observable<intostoresiteResponse> intostoresite(@Query("method") String method, @Query("token") String token, @Query("storesite") String storesite, @Query("barcode") String barcode, @Query("num") int num);

    //出库
    @POST("pdaservice.do")
    Observable<outstoresiteResponse> outstoresite(@Query("method") String method, @Query("token") String token, @Query("storesite") String storesite, @Query("barcode") String barcode, @Query("num") int num);

    //出库
    @POST("pdaservice.do")
    Observable<switchstoresiteResponse> switchstoresite(@Query("method") String method, @Query("token") String token, @Query("oldsite") String oldsite, @Query("newsite") String newsite, @Query("products") String products);


    //个人资料
    @GET("userInfo")
    Observable<userInfoResponse> userInfo(@Header("Authorization") String authorization);

    //个人资料修改
    @POST("updateUserInfo")
    Observable<updateUserInfoResponse> updateNickname(@Header("Authorization") String authorization, @Query("userInfo.nickname") String nickname);

    //个人资料修改
    @POST("updateUserInfo")
    Observable<updateUserInfoResponse> updateBirthday(@Header("Authorization") String authorization, @Query("userInfo.birthday") String birthday);

    //个人资料修改
    @POST("updateUserInfo")
    Observable<updateUserInfoResponse> updateHometown(@Header("Authorization") String authorization, @Query("userInfo.hometown") String hometown);


    //个人资料修改
    @POST("updateUserInfo")
    Observable<updateUserInfoResponse> updateLivingplace(@Header("Authorization") String authorization, @Query("userInfo.livingplace") String livingplace);


    //个人资料修改
    @POST("updateUserInfo")
    Observable<updateUserInfoResponse> updateSex(@Header("Authorization") String authorization, @Query("userInfo.sex") String sex);


    //个人资料修改
    @POST("updateUserInfo")
    Observable<updateUserInfoResponse> updateHobby(@Header("Authorization") String authorization, @Query("userInfo.hobby") String hobby);

    //个人资料修改
    @POST("updateUserInfo")
    Observable<updateUserInfoResponse> updateNativeDialect(@Header("Authorization") String authorization, @Query("userInfo.nativeDialect") String nativeDialect);

    //个人资料修改
    @POST("updateUserInfo")
    Observable<updateUserInfoResponse> updatePos(@Header("Authorization") String authorization, @Query("userInfo.pos") String pos);


    //密码修改
    @POST("updatePwd")
    Observable<updatePwdResponse> updatePwd(@Header("Authorization") String authorization, @Query("newPwd") String newPwd, @Query("oldPwd") String oldPwd);

    /****************************************课件中心*******************************************************/

    //推荐课件
    @POST("courseSearchByRecommended")
    Observable<courseSearchByRecommendedResponse> courseSearchByRecommended(@Header("Authorization") String authorization, @Query("page.currentPage") int page);

    //课件列表
    @POST("courseSearchByTypeAjax")
    Observable<courseSearchByTypeAjaxResponse> courseSearchByTypeAjax(@Header("Authorization") String authorization, @Query("type") int type, @Query("page.currentPage") int page);

    //课件详情
    @POST("courseSearchInfo")
    Observable<courseSearchInfoResponse> courseSearchInfo(@Header("Authorization") String authorization, @Query("id") int id);

    //课件列表
    @POST("examrecordList")
    Observable<examrecordListResponse> examrecordList(@Header("Authorization") String authorization, @Query("pass") boolean pass, @Query("page.currentPage") int page);


}
